package rpcclient

import "cloud_worm/util/proto/urpc"

type AgentEvent struct {
	AgentId 		string
	AgentIP 		string
	Version 		int
	EventType 		int

	NeedAgain		bool

	tryCount        int
}

func (w *AgentEvent) GetTryCount() int {
	return w.tryCount
}

func (w *AgentEvent) AddTryCount()  {
	w.tryCount++
	return
}

func (w *AgentEvent) GetMethodName() string {
	return "AgentEvent.EventPost"
}

func (w *AgentEvent) GetArgs() interface{} {
	return &urpc.AgentEventPostArgs{
		AgentId: w.AgentId,
		AgentIP: w.AgentIP,
		Version: w.Version,
		EventType: w.EventType,
	}
}

func (w *AgentEvent) GetReply() interface{} {
	return &urpc.AgentEventPostReply{}
}

func (w *AgentEvent) IsNeedAgain() bool {
	return w.NeedAgain
}
